Fix PM5 auto-off leaving the board unable to power back on - #3566
Open
nemanjan00 wants to merge 2 commits into
Open
Fix PM5 auto-off leaving the board unable to power back on#3566nemanjan00 wants to merge 2 commits into
nemanjan00 wants to merge 2 commits into
Conversation
bwm_autooff_check() released the power latch on the first VUSB-absent sample, ~250ms after VBUS was pulled. With a BWM fitted that lands while the AW32001E is still transitioning into Battery Discharge Mode, where BATFET is only turned fully on as part of that transition. The board powered down mid-transition and could then not be brought back up by button or by USB insertion - it looked dead until the cell was physically re-inserted. Require the absence to persist for 5s (20 consecutive 250ms samples) before acting, resetting the count whenever USB reappears. This is the grace period the function's own comment already described, and it also means a single spurious low reading on PC2 - a floating input, configured GPIO_PULL_NONE - can no longer power down a working device. The 5s figure is empirical rather than derived from a datasheet settling time. Other users report auto-off working on their boards, so this makes a marginal path robust rather than fixing something broken everywhere. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Om, this was only partial fix for me. If it stays off longer than a min-two minutes, I need to unplug battery to have it power on again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bwm_autooff_check() released the power latch on the first VUSB-absent sample, ~250ms after VBUS was pulled. With a BWM fitted that lands while the AW32001E is still transitioning into Battery Discharge Mode, where BATFET is only turned fully on as part of that transition. The board powered down mid-transition and could then not be brought back up by button or by USB insertion - it looked dead until the cell was physically re-inserted.
Require the absence to persist for 5s (20 consecutive 250ms samples) before acting, resetting the count whenever USB reappears. This is the grace period the function's own comment already described, and it also means a single spurious low reading on PC2 - a floating input, configured GPIO_PULL_NONE - can no longer power down a working device.
The 5s figure is empirical rather than derived from a datasheet settling time. Other users report auto-off working on their boards, so this makes a marginal path robust rather than fixing something broken everywhere.